#include "mainwindow.h"
#include <QApplication>
#include <QTranslator>
#include "logindialog.h"

int main(int argc, char *argv[])
{
    //qInstallMessageHandler(MessageOutput);

    QApplication a(argc, argv);
    a.setQuitOnLastWindowClosed(true);
    a.setOrganizationName("ManGen.Zhu");
    a.setOrganizationDomain("zhumangen.com");
    a.setApplicationName("DRWorkStation");

    QTranslator t;
    t.load(QCoreApplication::applicationDirPath() +  "/drworkstation_cn.qm");
    a.installTranslator(&t);

    if (LoginDialog().exec() != QDialog::Accepted)
        return -1;

    MainWindow w;
    w.showMaximized();

    return a.exec();
}
